
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<div class="modal-body">
		<form class="form-horizontal" action="" method="post" id="ajax_client_out_form">
			<input type="hidden" name="keyId" id="keyId" value="<s:property value="users.id" />">
			<fieldset>
				<legend>
					【<s:property value="users.name" />的剩余时间将会转到转入人员下】
				</legend>
				<div class="form-group">
					<div class="col-md-12">
                        <h8>
							<i class="fa fa-user"></i> <s:property value="users.name" /> 创建于 <i class="fa fa-clock-o"></i> <s:date name="users.createDate" format="yyyy-MM-dd HH:mm" /> 剩余<s:property value="validPeriod" />
                        </h8>
					</div>
				</div>
				<div class="form-group">
					<label class="col-md-3 control-label" for="name"><i class="fa fa-user"></i> 当前人员</label>
					<div class="col-md-9">
						<input class="form-control" name="name" id="name" disabled
							type="text" value="<s:property value="users.name" />">
					</div>
				</div>
				<div class="form-group">
					<label class="col-md-3 control-label" for="newId"><i class="fa fa-arrow-right"></i> 转入人员</label>
					<div class="col-md-9">
						<select  class="select2" id="newId" name="newId">
							<optgroup label="请选择转入帐号">
								<option value="">请选择...</option>
								<s:iterator value="usersList" id="userslist">
									<option value="<s:property value="#userslist.id"/>"><s:property value="#userslist.name"/></option>
								</s:iterator>
							</optgroup>
						</select>
					</div>
				</div>
			</fieldset>
		</form>
</div>
<div class="modal-footer">
	<a role="button" class="btn btn-primary" id="ajax_out_btn"> <i class="fa fa-save"></i> 确定</a>
	<a href="#" class="btn btn-default"  data-dismiss="modal" aria-hidden="true">关闭</a>
</div>

<script type="text/javascript">
	// DO NOT REMOVE : GLOBAL FUNCTIONS!
	pageSetUp();

    $("#ajax_out_btn").off("click").on("click",function(e){
		if($("#newId").val()==""){
			_show({
				title : "操作失败",
				state:"400",
				message:"请选择转出帐号"
			})
			return ;
		};
		var keyId = $("#keyId").val();
		var newId = $("#newId").val();
		var url = "ajax-users!moveCode.action";
		var data = {keyId:keyId,newId:newId};
		ajax_action(url,data,null,function(data){
			gDialog.fClose();
			$("#ajax_users_table").trigger("reloadGrid");
			_showResult(data);

		});
	});
</script>